<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑部门</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-4">
    <div class="row mb-3">
        <div class="col">
            <h1>编辑部门</h1>
        </div>
        <div class="col text-right">
            <a href="/departments" class="btn btn-secondary">返回部门列表</a>
        </div>
    </div>

    <div class="card">
        <div class="card-body">
            <form th:action="@{/departments/edit/{id}(id=${department.deptId})}" method="post" th:object="${department}">
                <input type="hidden" th:field="*{deptId}">
                
                <div class="form-group">
                    <label for="deptName">部门名称</label>
                    <input type="text" class="form-control" id="deptName" th:field="*{deptName}" required>
                </div>
                
                <div class="form-group">
                    <label for="description">描述</label>
                    <textarea class="form-control" id="description" th:field="*{description}" rows="3"></textarea>
                </div>
                
                <button type="submit" class="btn btn-primary">保存更改</button>
                <a href="/departments" class="btn btn-light">取消</a>
            </form>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>